/*
 * @Description: 请求体封装
 * @Author: hmt
 * @Date: 2022-08-22 00:28:38
 * @LastEditors: hmt
 * @LastEditTime: 2024-04-01 01:41:50
 */
import request from '@/utils/request'
import { AxiosRequestConfig } from 'axios'

const http = async (config: AxiosRequestConfig) => {
  const newConfig = { ...config }
  newConfig.url = process.env.VUE_APP_API + newConfig.url
  if (!newConfig.headers) newConfig.headers = {}
  if (!newConfig.method) newConfig.method = 'GET'
  const responseData = await request(newConfig) as any
  return responseData
}

export default http
